﻿cmake_minimum_required(VERSION 3.8)

SET(PROJECT_NAME HelloWorld)
project(${PROJECT_NAME})

SET(PROJECT_DIR ".")

# define output path
SET(CMAKE_INSTALL_PREFIX ${PROJECT_DIR})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX})
SET(LIBRARY_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX})

#UNICODE字符集
add_definitions(-DUNICODE -D_UNICODE)

#共享DLL中使用 MFC
add_definitions(-D_AFXDLL)

# set MFC flag
# 0 标准方式使用MFC库 1 在静态库中使用MFC,2共享方式使用mfc
set(CMAKE_MFC_FLAG 0)

# include files
FILE(GLOB SRC_FILES ${PROJECT_DIR}/*.cpp)
FILE(GLOB HEAD_FILES ${PROJECT_DIR}/*.h)
FILE(GLOB RC_FILES ${PROJECT_DIR}/*.rc ${PROJECT_DIR}/*.def)

# add_library(${PROJECT_NAME} SHARED ${SRC_FILES} ${HEAD_FILES} ${RC_FILES})
add_executable(${PROJECT_NAME} ${SRC_FILES} ${HEAD_FILES} ${RC_FILES})

#子系统窗口 
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
